package edu.sctu.wangxiaoqiang.day20150526;

/**
 * Created by user25 on 2015/5/26.
 */
public class TextEquals {
    /**
     *equals 运用
     * @param string
     * @return
     */

    public String getEquals(String string){
        if(string.equals("www")){
            string = "www";
        }else{
            string = "wwww";
        }
        return string;
    }


    /**
     *Substring 运用
     * @param string
     * @return
     */
    public String getSubstring(String string){
        String stringing = string.substring(2,6);
     return stringing;
    }

    /**
     * Lenght 运用
     * @param string
     * @return
     */
    public int getLenght(String string){
        int a = string.length();
        return  a;
    }

    /**
     * chart 运用
     * @param string
     * @return
     */
    public int getChart(String string, int num){
        int a = string.charAt(num);
        return  a;
    }

    public int getIndeof(String string){
        int a = string.indexOf(0,5);
        return  a;
    }

    public int getLastindexof(String string){
        int a = string.lastIndexOf(0,2);
        return  a;
    }

    public String getReplace(String string){
         String sttringing = string.replace('7', '.');
        return  sttringing;
    }

    public  String[] getSplit(String string){
        String[] stringing = string.split("123");
        return stringing;
    }

//    public String getStringLength(String string){
//           String str = string.lastIndexOf(8,2);
//        return str;
//    }

}
